38 #include "fsl_debug_console.h" 41 #include "clock_config.h" 45 #include "Driver_I2C_SDK2.h" 46 #include "fxas21002.h" 67 ARM_DRIVER_I2C*
I2Cdrv = &I2C_S_DRIVER_BLOCKING;
71 BOARD_InitDebugConsole();
72 I2Cdrv->Initialize(NULL);
74 I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
80 #if F_USING_ACCEL || F_USING_MAG void initSensorFusionGlobals(SensorFusionGlobals *sfg, StatusSubsystem *pStatusSubsystem, ControlSubsystem *pControlSubsystem)
utility function to insert default values in the top level structure
int32_t loopcounter
counter incrementing each iteration of sensor fusion (typically 25Hz)
conditionSensorReadings_t * conditionSensorReadings
preprocessing step for sensor fusion
int8_t FXOS8700_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void initializeStatusSubsystem(StatusSubsystem *pStatus)
initializeStatusSubsystem() should be called once at startup to initialize the data structure and to ...
PhysicalSensor sensors[3]
This implementation uses up to 3 sensors.
The top level fusion structure.
streamData_t * stream
function to create packets for serial stream
installSensor_t * installSensor
function for installing a new sensor into t
StatusSubsystem() provides an object-like interface for communicating status to the user...
ControlSubsystem controlSubsystem
used for serial communications
void pit_init(uint32_t microseconds)
readSensors_t * readSensors
read all physical sensors
struct ControlSubsystem * pControlSubsystem
initializeFusionEngine_t * initializeFusionEngine
set sensor fusion structures to initial values
int8_t MPL3115_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
updateStatus_t * updateStatus
status=next status
int main(void)
This is a bare-metal implementation of the NXP sensor fusion demo build.
int8_t FXOS8700_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXAS21002_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
The sensor_fusion.h file implements the top level programming interface.
int8_t MPL3115_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
Provides function prototypes for driver level interfaces.
he ControlSubsystem encapsulates command and data streaming functions.
uint8_t sUARTOutputBuffer[256]
main output buffer defined in control.c
int8_t initializeControlPort(ControlSubsystem *pComm)
Initialize the control subsystem and all related hardware.
runFusion_t * runFusion
run the fusion routines
Provides a simple abstraction for a periodic interval timer.
ARM_DRIVER_I2C * I2Cdrv
KSDK handle for the I2C port defined in Driver_I2C_KSDK2.c.
Application-specific status subsystem.
SensorFusionGlobals sfg
This is the primary sensor fusion data structure.
An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...
setStatus_t * queueStatus
queue status change for next regular interval
#define FUSION_HZ
(int) actual rate of fusion algorithm execution and sensor FIFO reads
Defines control sub-system.
StatusSubsystem statusSubsystem
provides visual (usually LED) status indicator
setStatus_t * setStatus
change status indicator immediately
applyPerturbation_t * applyPerturbation
apply step function for testing purposes
int8_t FXAS21002_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)